<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<c:if test="${registeredUserBean.loggedIn}">
	<c:redirect url="/user/home.faces"/>
</c:if>

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Login </title>
            <link rel="stylesheet" href="/EvIn/styles/styles.css" type="text/css" />
        </head>
        <a4j:keepAlive beanName="loginBean"/>
        <body style="background-color: white">

            <div id="wrapper" style="background-color: white;width: 700px">
                <div class="fullpane" style="background-color: white">

                    <div align="center">
                        <img src="/EvIn/static/images/logo1.png" width="70%"/>
                    </div>
                    <hr/>
                    <div align="center">
                        <h:form id="login">
                            <f:verbatim>
                                <div style="font-size: 11px" align="right">
                                    Not a member? Register <a href="/EvIn/register.faces">here</a>
                                </div>
                            </f:verbatim>


                            <h:panelGrid columns="2">
                                <h:outputLabel for="username" value="Username :  " />
                                <h:inputText  required="true" id="username" value="#{loginBean.username}" requiredMessage="Please enter your username"/>
                                <h:panelGroup/>
                                <h:message for="username" style="color: red; font-size: 10px"/>

                                <h:outputLabel for="password" value="Password :  "/>
                                <h:inputSecret  id="password" value="#{loginBean.password}" required="true" requiredMessage="Please enter your password"/>
                                <h:panelGroup/>
                                <h:message for="password" style="color: red; font-size: 10px"/>

                                <h:commandButton id="login" action="#{loginBean.login}" value="Login" />
                                <h:message for="login" style="color: red; font-size: 10px;" />

                            </h:panelGrid>

                        </h:form>
                    </div>
                </div>
            </div>
        </body>
    </html>
</f:view>

